import { http } from '@/utils/http'
import type { GoodsResult, IcollectResult, Icollectparams } from '@/types/goods'
import type { SetmealsItem } from '@/types/setmeal'

/**
 * 商品列表
 * @param data 分页参数
 */
/**
 * 商品详情
 * @param id 商品id
 */
export const getGoodsByIdAPI = (id: string) => {
  // return { result: {} as GoodsResult }
  return http<GoodsResult>({
    method: 'GET',
    url: '/sys/webchat/categories/gooddetail/' + id,
    data: {},
  })
}

export const getSetmealsByIdAPI = (id: string) => {
  return http<SetmealsItem>({
    method: 'GET',
    url: '/sys/webchat/categories/setmealGoodDetail/' + id,
    data: {},
  })
}

export const getCollectStatusAPI = (data: Icollectparams) => {
  return http<number>({
    method: 'POST',
    url: '/sys/app/collect/status',
    data,
  })
}
export const editStatusAPI = (data: IcollectResult) => {
  return http({
    method: 'POST',
    url: '/sys/app/collect/editStatus',
    data,
  })
}
